<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<style>
		article {
			margin-top: 20px;
		}

		#one {
			width: 500px;
			height: 500px;
			border: 1px solid red;
			display: grid;
			grid-template-columns: 50% 50%;
			grid-template-rows: 20% 20% 20% 20% 20%;
		}

		#two {
			width: 100px;
			height: 200px;
			border: 1px solid red;
			display: grid;
			grid-template-columns: repeat(5, minmax(50px, 100px));
			grid-template-rows: repeat(2, 1fr);

		}
		/* 
			使用repeat时，可以宽松调整 设置宽度区间  minmax(最小宽度，最大宽度)
			意味着单元格的宽/高 会根据父盒子的大小 在二者之间变化  
			如果盒子过大，则会出现留白的地方
			如果盒子过小，则会导致盒子虽然规定了宽度，但是其宽度最终是minmax中的最小值✖重复数
		*/
		#three {
			width: 500px;
			height: 200px;
			border: 1px solid red;
			display: grid;
			grid-template-columns: 20% 20% 20% 20% 20%;
			grid-template-rows: 50% 50%;
		}

		div {
			border: 1px solid green;
			background: blueviolet;
			background-clip: content-box;
			padding: 5px;
			box-sizing: border-box;
		}
	</style>
</head>

<body>
	<article id="one">
		<div>1</div>
		<div>2</div>
		<div>3</div>
		<div>4</div>
		<div>5</div>
		<div>6</div>
		<div>7</div>
		<div>8</div>
		<div>9</div>
		<div>10</div>
	</article>
	<!--  -->
	<article id="two">
		<div>1</div>
		<div>2</div>
		<div>3</div>
		<div>4</div>
		<div>5</div>
		<div>6</div>
		<div>7</div>
		<div>8</div>
		<div>9</div>
		<div>10</div>
	</article>
	<article id="three">
		<div>1</div>
		<div>2</div>
		<div>3</div>
		<div>4</div>
		<div>5</div>
		<div>6</div>
		<div>7</div>
		<div>8</div>
		<div>9</div>
		<div>10</div>
	</article>
</body>

</html>